﻿<Window x:Class="MContracts.Controls.Dialogs.AutoBindAgreementOriginStagesDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converters="clr-namespace:MContracts.Classes.Converters" 
        Title="Автоматическое связывание этапов ДС-оригинальный" Height="200" Width="300" MinHeight="200" MinWidth="300" MaxHeight="200" MaxWidth="300" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
    
    <Window.Resources>
        <converters:NegativeBoolConverter x:Key="NegativeBoolConverter" />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <GroupBox Grid.Row="0" Grid.Column="0">
            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <CheckBox Content="по номеру этапа" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="10,10,0,0" Name="chbxStageNum" VerticalAlignment="Stretch"  IsChecked="{Binding Path=UseStagenum}" IsEnabled="{Binding Path=ClearBinding, Converter={StaticResource NegativeBoolConverter}}"/>
                <CheckBox Content="по названию этапа" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="10,10,0,0" Name="chbxStageName" VerticalAlignment="Stretch"  IsChecked="{Binding Path=UseStagename}" IsEnabled="{Binding Path=ClearBinding, Converter={StaticResource NegativeBoolConverter}}" />
                <CheckBox Content="по коду стройки"  HorizontalAlignment="Stretch" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="10,10,0,0" Name="chbxObjectCode" VerticalAlignment="Stretch" IsChecked="{Binding Path=UseObjectcode}" IsEnabled="{Binding Path=ClearBinding, Converter={StaticResource NegativeBoolConverter}}" />
                <CheckBox Content="очистить привязку (кроме закрытых)" HorizontalAlignment="Stretch" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"  Margin="10,10,0,0" Name="chbxClearBinding"  VerticalAlignment="Stretch" IsChecked="{Binding Path=ClearBinding}" />
            </Grid>
        </GroupBox>
        
        <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="1"  HorizontalAlignment="Right" Width="Auto">
            <Button Content="OK" Width="70" Height="25" HorizontalAlignment="Right" Margin="10,10,10,10"  IsCancel="False" Click="Button_Click" IsEnabled="{Binding Path=ConditionSetted}" />
            <Button Content="Отмена" Width="70" Height="25" Margin="10,10,10,10" HorizontalAlignment="Right" IsCancel="True"/>
        </StackPanel>
    </Grid>

</Window>
